package com.it.myd.service.main.module.article;

import com.it.myd.bean.box.Article;
import com.it.myd.bean.main.File;
import com.it.myd.bean.main.User;
import com.it.myd.dao.main.module.article.ArticleDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ArticleServiceImpl implements ArticleService{

    @Autowired
    private ArticleDao articleDao;

    @Override
    public Integer getArticleId() {
        return articleDao.getArticleId();
    }

    @Override
    public void InsertUserProFile(File file) {
        articleDao.InsertUserProFile(file);
    }

    @Override
    public void updateUserProFile(File file) {
        articleDao.updateUserProFile(file);
    }

    @Override
    public Article selectArticle(Article article) {
        return articleDao.selectArticle(article);
    }

    @Override
    public List<Article> selectArticles(Article article) {
        return articleDao.selectArticles(article);
    }
    @Override
    public List<Article> selectArticlesHot(Article article) {
        List<Article> articleList = articleDao.selectArticlesHot(article);
        return articleList.subList(0, 5);
    }

    @Override
    public void insertArticle(Article article) {
        articleDao.insertArticle(article);
    }

    @Override
    public void updateArticle(Article article) {
        articleDao.updateArticle(article);
    }

    @Override
    public void deleteArticle(Article article) {
        articleDao.deleteArticle(article);
    }

    @Override
    public void addUpCount(Article article) {
        articleDao.addUpCount(article);
    }

    @Override
    public void subUpCount(Article article) {
        articleDao.subUpCount(article);
    }

    @Override
    public void subDownCount(Article article) {
        articleDao.subDownCount(article);
    }

    @Override
    public void addDownCount(Article article) {
        articleDao.addDownCount(article);
    }
}
